package com.example.quartz.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author 高垚淼
 * @version 1.0
 */
@Component("TestTask")
@Slf4j
public class TestTask {
    @Autowired
    RedisTemplate redisTemplate;
    public void test(){
        Date date = new Date();
        redisTemplate.opsForValue().set("TestTask",date);
        log.info("TestTask");
        System.out.println("test"+ LocalDateTime.now());
    }
}
